#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<malloc.h>
#include<cstdio>
#include<time.h>
#include<stdlib.h>
const int N = 100000;
typedef int HDataType;
typedef struct Heap {
	HDataType* a;
	int capacity;
	int size;
}Heap;

void HeapInit(Heap* hp);

void UpAdjust(Heap* hp, HDataType x);

void HeapPush(Heap* hp, HDataType x);
void HeapDelete(Heap* hp);

void HeapDestory(Heap* hp);

HDataType HeapTop(Heap* hp);

int HeapSize(Heap* hp);
int HeapEmpty(Heap* hp);

void heapSort(HDataType* a, int n);
void DownAdjust(HDataType* hp, int n, int parent);

